<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.identity.entity.LoginUserVO" %>
<%@ page import="com.apexedu.identity.security.CasLoginUtil" %>
<%@ page import="com.apexedu.util.StringUtil" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Random" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:useBean id="showBean" scope="application" class="com.apexedu.biz.IndexPageQuery" />
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    request.setAttribute("basePath", basePath);
    SimpleDateFormat sdf_time = new SimpleDateFormat("yyyy/MM/dd");
    String menuid = (String)request.getAttribute("id");
    Random rand =new Random();
    LoginUserVO tsysUser = (LoginUserVO) session.getAttribute(IdConstants.SESSION_USER);
    String userid="";
    String username="";
    if (tsysUser!=null){
        userid =tsysUser.getUserloginid();
        username=tsysUser.getUsername();
    }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>山东大学网上服务大厅</title>
    <script src="${basePath}/resources/js/shd/jquery.js"></script>
    <link href="${basePath}/resources/css/shd/style.css" rel="stylesheet" type="text/css" />
    <link href="${basePath}/resources/css/shd/slide.css" rel="stylesheet" type="text/css" />
    <script type="application/javascript">
        var imgUrl = 'http:///202.194.7.34:8080/';
        var intss;
        $(function () {
            intss = setInterval("countDown()", 500);
        });
        function countDown() {
            if ($("img[src*='/UserFiles']:not([src*='http://202.194.7.34:8080'])").length > 0) {
                $("img[src*='/UserFiles']:not([src*='http://202.194.7.34:8080'])").attr("src", function () {
                    var src = $(this).attr("src");
                    return imgUrl + src.substring(src.indexOf("/UserFiles"));
                });
            } else {
                window.clearInterval(intss);
            }
        }
        var basePath = '${basePath}';
        function execLogout() {
            <%
            if( CasLoginUtil.isSsoEnabled() ){
              // 通知业务系统liveBos登出。
              // 这里的地址是根据项目现场业务系统地址在门户管理后台的系统参数维护里修改。参数名用“livebos.urls”
                String liveBosUrl = SysPropertiesUtil.get("livebos.urls");
                if(StringUtil.isNotBlank(liveBosUrl)){
                    String[] liveBosUrls = liveBosUrl.split(",");
                    for(String url : liveBosUrls){
                        out.println("$(\"<iframe src='"+url+"/logout.do' height='0' frameborder='0'/>\").appendTo(\"body\");");
                    }
                }
            }
            %>
            $.get("${basePath}/identity/ajaxlogin.action?act=logout", {q: (new Date()).getTime()}, function (data) {
                data = eval("(" + data + ")");
                if (data.msg == 'success') {
                    <%
                if( CasLoginUtil.isSsoEnabled() ){
                %>
                    window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>?t=' + Math.round(new Date / 1000);
                    <%
                    }else{
                    %>
                    window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                    <%
                    }
                    %>
                } else {
                    alert(data.msg);
                }
            });

        }
    </script>
</head>
<body>
<body>
<!--header开始-->
<div class="header-wide bgRed">
    <div class="fontYH " style="width: 1136px; margin: 0 auto">
        <div style="height: 56px; width: 418px; float: left; background-image: url('${basePath}/resources/images/shd/index/logol.png')">
        </div>
        <div class="topMenu">
            <ul>
                <li><a href="${basePath}">首页</a></li>
                <li><a href="${basePath}/s/shd/fwdh">服务导航</a></li>
                <%
                    if(StringUtil.isBlank(userid)){
                %>
                <li><a href="${basePath}/index_login.jsp">用户登录</a></li>
                <%
                }else{
                %>
                <li><a href="${basePath}/s/uc/shd/ph">个人中心</a></li>
                <li><a href="#" onclick="execLogout()">注销</a></li>
                <%
                    }
                %>
            </ul>
        </div>
    </div>
</div>
<!--header结束-->
<!--右侧边滚动栏内容开始-->
<aside id="rightSide" class="panel-lv2">
</aside>
<!--右侧边栏滚动内容结束-->
<!--NSews Details开始-->
<div class="fence-wide service">
    <div class="yard-1136 mb12 mt20">
        <div class="news-tit fontYH">
            <div class="news-posi fontYH">
                <span class="">你现在的位置：</span>
                <span class="">--<a>首页</a></span>
                <span class="">--<a>通知公告</a></span>
                <span class="">--正文</span>
            </div>
        </div>
        <div class="news-con fontYH">
            <div class="n-title">
                ${twz.title }
            </div>
            <div class="n-smtitle">
                发布时间：<fmt:formatDate value="${twz.cjrq}" pattern="yyyy.MM.dd"/>发布单位：<a style="color: blue">${twz.departname}</a>  浏览次数：${twz.djs }次
            </div>
            <div class="n-n" >
                ${twz.nr }
            </div>
        </div>
    </div>
</div>
<!--NewsDetails开始-->
<!--快捷通道开始-->
<div class="service">
    <div class="channel ">
        <div class="channel-q">
            <ul>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k1.png" alt="课程录播" width="92" height="92" /></a></li>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k2.png" alt="个人主页" width="92" height="92" /></a></li>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k3.png" alt="山大通" width="92" height="92" /></a></li>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k4.png" alt="迎新系统" width="92" height="92" /></a></li>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k5.png" alt="邮件系统" width="92" height="92" /></a></li>
                <li><a href=""><img src="${basePath}/resources/images/shd/index/icon/k6.png" alt="山大网关" width="92" height="92" /></a></li>
            </ul>
        </div>
    </div>
</div>
<!--快捷通道结束-->
<!--footer开始-->
<%@include file="./public_foot.jsp"%>
<!--footer结束-->
</body>
</html>
